package com.ruoyi.shop.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.mapper.TbBusinessMapper;
import com.ruoyi.shop.domain.TbBusiness;
import com.ruoyi.shop.service.ITbBusinessService;

/**
 * 商家Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-01-30
 */
@Service
public class TbBusinessServiceImpl implements ITbBusinessService 
{
    @Autowired
    private TbBusinessMapper tbBusinessMapper;

    /**
     * 查询商家
     * 
     * @param businessId 商家主键
     * @return 商家
     */
    @Override
    public TbBusiness selectTbBusinessByBusinessId(Integer businessId)
    {
        return tbBusinessMapper.selectTbBusinessByBusinessId(businessId);
    }

    /**
     * 查询商家列表
     * 
     * @param tbBusiness 商家
     * @return 商家
     */
    @Override
    public List<TbBusiness> selectTbBusinessList(TbBusiness tbBusiness)
    {
        return tbBusinessMapper.selectTbBusinessList(tbBusiness);
    }

    /**
     * 新增商家
     * 
     * @param tbBusiness 商家
     * @return 结果
     */
    @Override
    public int insertTbBusiness(TbBusiness tbBusiness)
    {
        tbBusiness.setCreateTime(DateUtils.getNowDate());
        return tbBusinessMapper.insertTbBusiness(tbBusiness);
    }

    /**
     * 修改商家
     * 
     * @param tbBusiness 商家
     * @return 结果
     */
    @Override
    public int updateTbBusiness(TbBusiness tbBusiness)
    {
        tbBusiness.setUpdateTime(DateUtils.getNowDate());
        return tbBusinessMapper.updateTbBusiness(tbBusiness);
    }

    /**
     * 批量删除商家
     * 
     * @param businessIds 需要删除的商家主键
     * @return 结果
     */
    @Override
    public int deleteTbBusinessByBusinessIds(Integer[] businessIds)
    {
        return tbBusinessMapper.deleteTbBusinessByBusinessIds(businessIds);
    }

    /**
     * 删除商家信息
     * 
     * @param businessId 商家主键
     * @return 结果
     */
    @Override
    public int deleteTbBusinessByBusinessId(Integer businessId)
    {
        return tbBusinessMapper.deleteTbBusinessByBusinessId(businessId);
    }
}
